"use strict";
cc._RF.push(module, 'c5c14wUxHhLI7c7DqgVWMvo', 'player_node');
// scripts/player_node.js

"use strict";

var e = require;
var t = module;
var o = exports;

var _ii,
    nn = void 0 && (void 0).__extends || (_ii = function ii(t, e) {
  return (_ii = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _ii(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    rr = void 0 && (void 0).__awaiter || function (t, e, o, i) {
  return new (o || (o = Promise))(function (n, a) {
    function r(t) {
      try {
        l(i.next(t));
      } catch (e) {
        a(e);
      }
    }

    function s(t) {
      try {
        l(i["throw"](t));
      } catch (e) {
        a(e);
      }
    }

    function l(t) {
      var e;
      t.done ? n(t.value) : (e = t.value, e instanceof o ? e : new o(function (t) {
        t(e);
      })).then(r, s);
    }

    l((i = i.apply(t, e || [])).next());
  });
};

var oo = void 0 && (void 0).__decorate || function (e, t, a, n) {
  var i,
      o = arguments.length,
      s = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, a) : n;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n);else for (var r = e.length - 1; r >= 0; r--) {
    (i = e[r]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, a, s) : i(t, a)) || s);
  }
  return o > 3 && s && Object.defineProperty(t, a, s), s;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});

var a = e("BaseModuleUI"),
    n = e("NotifyEventType"),
    i = e("GlobalParams"),
    r = e("role_node"),
    s = cc._decorator,
    l = s.ccclass,
    _ = (s.property, function (e) {
  function t() {
    var t = null !== e && e.apply(this, arguments) || this;
    return t.role_node = null, t;
  }

  return nn(t, e), t.prototype.initView = function () {
    this.role_node = this.node.getComponent(r["default"]);
  }, t.prototype.addEvent = function () {
    this.attachEvent(n["default"].SEND_PLAYER_MOVE_INFO, this.playerMoveInfo, this), this.attachEvent(n["default"].SEND_PLAYER_STOP_MOVE_INFO, this.playerStopMove, this), this.attachEvent(n["default"].SEND_PLAYER_FREE_SKILL, this.showPlayerSkill, this), this.attachEvent(n["default"].SEND_PLAYER_FREE_SKILL_ONE, this.showSkillOne, this), this.attachEvent(n["default"].SEND_PLAYER_FREE_SKILL_TWO, this.showSkillTwo, this), this.attachEvent(n["default"].SEND_PLAYER_FREE_SKILL_THREE, this.showSkillThree, this), this.attachEvent(n["default"].SEND_PLAYER_USE_PLAYER_SKILL, this.usePlayerSkill, this);
  }, t.prototype.playerMoveInfo = function (e, t) {
    i.GlobalParams.GameStart && this.role_node.roleMoveInfo(t);
  }, t.prototype.playerStopMove = function () {
    i.GlobalParams.GameStart && this.role_node.roleStopMove();
  }, t.prototype.showPlayerSkill = function () {
    this.role_node.roleCommonSkill();
  }, t.prototype.showSkillOne = function () {
    i.GlobalParams.MatchGamePlayer[i.GlobalParams.MatchMyIndex].skill_info[0] > 0 && this.role_node.roleSpecialSkillOne();
  }, t.prototype.showSkillTwo = function () {
    i.GlobalParams.MatchGamePlayer[i.GlobalParams.MatchMyIndex].skill_info[1] > 0 && this.role_node.roleSpecialSkillTwo();
  }, t.prototype.showSkillThree = function () {
    i.GlobalParams.MatchGamePlayer[i.GlobalParams.MatchMyIndex].skill_info[2] > 0 && this.role_node.roleSpecialSkillThree();
  }, t.prototype.usePlayerSkill = function (e, t) {
    if (i.GlobalParams.GameStart) switch (t) {
      case 1:
        cc.log("===疾跑==="), this.role_node.showSprintSkill();
        break;

      case 2:
        cc.log("===加血==="), this.role_node.showAddHpSkill();
        break;

      case 3:
        cc.log("===点燃==="), this.role_node.showLightSkill();
        break;

      case 4:
        cc.log("===虚弱==="), this.role_node.showWeaknessSkill();
        break;

      case 5:
        cc.log("===斩杀==="), this.role_node.showKillSkill();
        break;

      case 6:
        cc.log("===闪现==="), this.role_node.showFlashSkill();
    }
  }, oo([l], t);
}(a["default"]));

o["default"] = _;

cc._RF.pop();